package com.wicket.okrcomponent.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import com.wicket.okrcomponent.common.util.RedisUtil;
import com.wicket.okrcomponent.common.exception.BizException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

import java.util.List;
import java.util.stream.Collectors;
import com.wicket.okrcomponent.biz.service.nb.NbStatisticalData;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class StatisticalDataServiceImpl implements com.wicket.okrcomponent.biz.service.StatisticalDataService {
    @Resource
    private RedisUtil redisUtil;
//@Resource
 //private MCustomFieldsService mCustomFieldsService;
@Resource
  private NbStatisticalData nbStatisticalData;
/**
   * D2计算数据集内容条数服务(公共)[3386]
   * gen by moon at 12/2/2022, 10:21:35 PM
   */
  @Trace(operationName = "D2计算数据集内容条数服务(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public CalculateContentAmountComRespDto calculateContentAmountCom(CalculateContentAmountComReqDto reqDto){
    
      
      CalculateContentAmountRespDto getDataCountRes_1 =null;
//步骤0: M2计算内容条数(特殊方法） - calculateContentAmount
     //ModelCode: getDataCount
        CalculateContentAmountRespDto getDataCountRes = null;
    CalculateContentAmountReqDto getDataCountReq=new CalculateContentAmountReqDto();
  if(reqDto!=null){
      getDataCountReq.setContentAmountList(reqDto.getContentAmountList());//list-field-assign//sourceId:134667_1
    }
  
    /*M2计算内容条数(特殊方法）[3384]  入参一个数据集，返回数据集条数 */
    
      getDataCountRes = nbStatisticalData.calculateContentAmount(getDataCountReq);
      
      
      getDataCountRes_1 = getDataCountRes;
    
CalculateContentAmountComRespDto retData = new CalculateContentAmountComRespDto();
  if(getDataCountRes_1!=null){
      retData.setCalcCount(getDataCountRes_1.getCalcCount());//SimpleFieldAssign//sourceId:134670_1
    }
  

  
  
return retData;
  }
    
    //
}
